package com.bigchui.DesignPattern.Singleton.lazy;

/**
 * double check单例
 * Created by wangzhen on 2019/3/9.
 */
public class LazyDoubleCheckSingleton {
    private LazyDoubleCheckSingleton(){

    }
    private static LazyDoubleCheckSingleton lazyDoubleCheckSingleton;

    public static LazyDoubleCheckSingleton getInstance(){
        if(lazyDoubleCheckSingleton == null){
            synchronized (LazyDoubleCheckSingleton.class){
                if(lazyDoubleCheckSingleton == null){
                    lazyDoubleCheckSingleton = new LazyDoubleCheckSingleton();

                }
            }
        }
        return lazyDoubleCheckSingleton;
    }
}
